package chapter2.No2_2_synchronized同步语句块.g将任意对象作为对象监视器.demo1;

/**
 * *：synchronized(非this对象x) 对象监视器同步
 * Created by Administrator on 2016/11/12.
 */
public class Main {

    public static void main(String[] args) {
        ServiceClass sc = new ServiceClass();
        ThreadA a = new ThreadA(sc);
        a.setName("a");
        ThreadB b = new ThreadB(sc);
        b.setName("b");

        a.start();
        b.start();
    }
}
